package com.qunar.train.mock.network;

import java.io.ByteArrayInputStream;

/**
 * @author: xudong.tai
 * @since: 2018/8/14 Description:
 **/
public class MockMultipartFile implements org.springframework.web.multipart.MultipartFile {

    private java.lang.String getContentTypeReturnValue = null;
    private byte[] getBytesReturnValue = new byte[0];
    private java.lang.String getOriginalFilenameReturnValue = null;
    private java.lang.String getNameReturnValue = null;


    public java.lang.String getContentType() {
        return this.getContentTypeReturnValue;
    }

    public byte[] getBytes() {
        return this.getBytesReturnValue;
    }

    public java.io.InputStream getInputStream() {
        return new ByteArrayInputStream(this.getBytesReturnValue);
    }

    public boolean isEmpty() {
        return (this.getBytesReturnValue.length == 0);
    }

    public java.lang.String getOriginalFilename() {
        return this.getOriginalFilenameReturnValue;
    }

    public long getSize() {
        return this.getBytesReturnValue.length;
    }

    public java.lang.String getName() {
        return this.getNameReturnValue;
    }

    public void transferTo(java.io.File arg0) {
    }


    public void setContentType(java.lang.String p) {
        this.getContentTypeReturnValue = p;
    }

    public void setBytes(byte[] p) {
        this.getBytesReturnValue = p;
    }

    public void setOriginalFilename(java.lang.String p) {
        this.getOriginalFilenameReturnValue = p;
    }

    public void setName(java.lang.String p) {
        this.getNameReturnValue = p;
    }


    public void clear() {
        this.getContentTypeReturnValue = null;
        this.getBytesReturnValue = new byte[0];
        this.getOriginalFilenameReturnValue = null;
        this.getNameReturnValue = null;
    }


}
